package com.growthsee.rider.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Objects;

public class DateUtils {
    private static final SimpleDateFormat ft = new SimpleDateFormat("yyyy.MM.dd hh:mm:ss");

    /**
     * 时间格式化
     * @param date
     * @param df
     * @return
     */
    public static String date2Str(Date date,SimpleDateFormat df){
        if(Objects.isNull(df)){
            return ft.format(date);
        }
        return df.format(date);
    }
}
